package com.vhall.component.controller.account;


import com.vhall.component.controller.account.facade.AccountInnerFacade;
import com.vhall.component.entity.account.vo.AccountVO;
import com.vhall.component.entity.export.dto.AdminExportCommonQueryCondition;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.service.account.AccountService;
import com.vhall.component.service.account.AdminInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Collections;
import java.util.List;

/**
 * 用户表前端控制器
 *
 * @author CodeGenerator
 * @date 2021-04-06 17:09:56
 */
@VhallComponent
public class AccountInnerController implements AccountInnerFacade {

    @Autowired
    private AccountService accountService;

    @Autowired
    private AdminInfoService adminInfoService;

    /**
     * 查询账户信息
     *
     * @param ids 参数
     * @return
     */
    @Override
    public List<AccountVO> list(String ids) {
        if (StringUtils.isEmpty(ids)) {
            return Collections.emptyList();
        }
        return accountService.listByIds(ids);
    }

    /**
     * 过滤观看账户
     *
     * @param ids 参数
     * @return
     */
    @Override
    public List<Integer> filterAccountType(List<Integer> ids) {
        return accountService.filterAccountType(ids);
    }

    @Override
    public Integer countUserForAdminExport(Integer userType, AdminExportCommonQueryCondition condition) {
        return accountService.countUserForAdminExport(userType, condition);
    }

    @Override
    public Integer countAdminForAdminExport(AdminExportCommonQueryCondition condition) {
        return adminInfoService.countAdminForAdminExport(condition);
    }

}